package com.wrb.manage.service;

import com.wrb.manage.mapper.AppointmentMapper;
import com.wrb.manage.model.Appointment;
import com.wrb.manage.model.AppointmentCriteria;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author wrb
 * @date 2019/12/6 11:40
 */
@Service
public class AppointmentService {

	@Autowired
	private AppointmentMapper appointmentMapper;

	public int insertAppointment(Appointment appointment) {
		return appointmentMapper.insertSelective(appointment);
	}

	public List getList() {
		AppointmentCriteria criteria = new AppointmentCriteria();
		criteria.setOrderByClause(" create_time desc");
		return this.appointmentMapper.selectByExample(criteria);
	}
}
